﻿using System;

namespace TextEditor
{
    

    public class A_SetInputFormat : A_Action
    {
        public override string ActionName()
        {
            return "setinputformat";
        }

        public override bool Execute()
        {
            ZYTextInput parent = base.myOwnerDocument.Content.CurrentElement.Parent as ZYTextInput;
            if (parent != null)
            {
                //using (dlgFormat format = new dlgFormat())
                //{
                //    format.myFormat = parent.Format;
                //    format.ShowDialog();
                //    if (format.bolModify)
                //    {
                //        parent.TestValueFormat();
                //        base.myOwnerDocument.RefreshElement(parent);
                //        base.myOwnerDocument.Modified = true;
                //        return true;
                //    }
                //}
            }
            return false;
        }

        public override bool isEnable()
        {
            return (((base.myOwnerDocument.CanModify() && (base.myOwnerDocument.Content.CurrentElement != null)) && (base.myOwnerDocument.Content.CurrentElement.Parent is ZYTextInput)) && base.isEnable());
        }
    }
}

